package com.gitee.chili.leisure.util.functional;

/**
 * Function
 *
 * @author week solider
 * @since 2020-07-06
 */

@FunctionalInterface
public interface Function<T> {

    void apply(T param);

    static void foreach(int count, Function<Integer> function) {
        foreach(0, count, function);
    }

    static void foreach(int begin, int count, Function<Integer> function) {
        for (int i = begin; i < count; i++) {
            function.apply(i);
        }
    }
}
